package middleware

import (
	"hft/tools"

	"github.com/gin-gonic/gin"
)

func FenFaSite() gin.HandlerFunc {
	return func(c *gin.Context) {
		claims, _ := tools.GetClaims(c)
		user_type := c.Request.Header.Get("site")
		if user_type != claims.UserType {
			c.JSON(401, "登录失效")
		}
		c.Next()
	}
}
